added the delete validation functionality