changed the way deleted button works