delete when button is clicked function added