added time of day in night detection