fixed faulty regname recovery