fix bug and add hook_weight_delete