Erase function works on click.