exception handling for sonar sensors