missing return statement in waitFn