fix promise correctness