added erase button code to index