Waiting script improved