fix bugs of promise