check if return value is a promise