Fixed bug not calling promise callback