added validation for tokens