validation and delete action