diff --git a/lib/_autoload.php b/lib/_autoload.php
index 6e6a65c010c94cd294f1ee7a730076735e151d61..d81930095ee9fd89b333ca064d20f2ca7eb5676e 100644
--- a/lib/_autoload.php
+++ b/lib/_autoload.php
@@ -10,8 +10,8 @@
 
 // SSP is loaded as a separate project
 $libpath = \SimpleSAML\Utils\System::resolvePath(dirname(dirname(__FILE__)).'/vendor/autoload.php'));
-if (file_exists($prjpath) {
-    require_once $prjpath;
+if (file_exists($libpath) {
+    require_once $libpath;
 } else {  // SSP is loaded as a library
     $libpath = \SimpleSAML\Utils\System::resolvePath(dirname(dirname(__FILE__)).'/../../autoload.php'));
     if (file_exists($libpath) {