Changing the wait function status