Fix minor error in promise
Fix undeclared issue in promise