Fixing promise code flow.