got delete function to work