move outside of the promise