diff --git a/VERSION b/VERSION
index 0ea3a944b399d25f7e1b8fe684d754eb8da9fe7f..0c62199f16ac1e2d7f7ae75b420c1231325dff4e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.2.0
+0.2.1
diff --git a/pirati.php b/pirati.php
index e84ca7088cae323a6cee6e9835c49cfb89d60b0c..3b218a84d31625344409a21e3e0bf31d33e01dd0 100644
--- a/pirati.php
+++ b/pirati.php
@@ -110,6 +110,11 @@ class pirati extends \phpbb\auth\provider\oauth\service\base
                 throw new \phpbb\auth\provider\oauth\service\exception('AUTH_PROVIDER_OAUTH_RETURN_ERROR');
         }
 
+        $ch = curl_init();
+        curl_setopt($ch, CURLOPT_URL, "https://chobotnice.pirati.cz/import-person/" . $result['sub'] . "/");
+        curl_exec($ch);
+        curl_close($ch);
+
         return $result['sub'];
 
     }
@@ -138,11 +143,6 @@ class pirati extends \phpbb\auth\provider\oauth\service\base
                 throw new \phpbb\auth\provider\oauth\service\exception('AUTH_PROVIDER_OAUTH_RETURN_ERROR');
         }
 
-        $ch = curl_init();
-        curl_setopt($ch, CURLOPT_URL, "https://chobotnice.pirati.cz/import-person/" . $result['sub'] . "/");
-        curl_exec($ch);
-        curl_close($ch);
-
         return $result['sub'];
 
     }