fix promise then method