Passes result correctly between promises