fix sensor initialization bug