fixing promise chain