fix some bugs of model.on_delete