fix promises and return values