improve the "request cancel" function