improved waiting mechanism