Wait for promise before transitioning