Added error checking for the us sensor