updated erase method