fix bug with sensor