fixing issue if no sensor is assigned