use cancel method correctly