fix promise resolution