fixed access of fields for token generation