fixed the return of promise