support adding ref at runtime.