fix reg problem