fix for wait