diff --git a/libs/libarchfpga/src/read_xml_arch_file.cpp b/libs/libarchfpga/src/read_xml_arch_file.cpp
index 34bbca36c..7dfe58689 100644
--- a/libs/libarchfpga/src/read_xml_arch_file.cpp
+++ b/libs/libarchfpga/src/read_xml_arch_file.cpp
@@ -995,11 +995,10 @@ static std::pair<int, int> ProcessPinString(pugi::xml_node Locations,
                                "Found an open '[' but miss close ']' of the port: %s\n", pin_loc_string);
             }
         }
+        token_index++;
+        token = tokens[token_index];
     }
 
-    token_index++;
-    token = tokens[token_index];
-
     if (token.type != TOKEN_DOT) {
         archfpga_throw(loc_data.filename_c_str(), loc_data.line(Locations),
                        "No dot is present to separate type name and port name: %s\n", pin_loc_string);