Implemented autocancel() function