Enhances the database delete function.