added delete button funtion as helper