changed key from pk to ref. now 3 letter codes are allowed