Fix the on_delete method.