corrected the method canonicalizeName()