add a cancel function can cancel the current promise