Checking for duplicate tokens