Added uniqueness check and tokenrules.