Implemented closures for wait