Prepared code for cancel erasing