sensor now working correctly