Fix promise resolve