fix --registry not take effect