Fix for wait method