wait instead of sleep