added isPromise function