waiting time calculation fixed