modified the search for free time slot