modifed cancel event