wait() fix