Fixed bugs on permits_ids and time_range