Added max to waiting time