Added proper error handling, when sensor is not available