fix bad use of promise in resolve