Fixed error in AID registration code