fixed bug, add promise