fixing promise issues