fixed delete method to throw exception if record not found