fixed promise handler undefined