fixed bug in sensor check