Cancel event handler fix