fix auto register bug