handle what happens when a promise is returned