I'm not sure what's causing the problem, but if it is only when you send a SMS, you could implement some code that would skip over the ultrasonic sensor for however many times after you send a SMS.
I'm not sure what's causing the problem, but if it is only when you send a SMS, you could implement some code that would skip over the ultrasonic sensor for however many times after you send a SMS.