removed unwanted 'if wait else None'