diff --git a/ldap_sso/ldap_sso.module b/ldap_sso/ldap_sso.module
index 9d827cf..024729d 100644
--- a/ldap_sso/ldap_sso.module
+++ b/ldap_sso/ldap_sso.module
@@ -58,10 +58,12 @@ function ldap_sso_boot() {
           $login_attempted = FALSE;
         }
         require_once('includes/common.inc');
+        require_once('includes/path.inc');
         $ldap_authentication_conf = variable_get('ldap_authentication_conf', array());
         if ($ldap_authentication_conf['seamlessLogin'] == 1 && ($login_attempted != 'true')) {
           setcookie("seamless_login_attempted", 'true', time() + (int)$auth_conf->cookieExpire, base_path(), "");
           $_SESSION['seamless_login_attempted'] = $login_attempted;
+          if(!isset($_GET['q']) || $_GET['q'] == '') $_GET['q'] = 'user';
           drupal_goto('user/login/sso', array('query' => array('destination' => rawurlencode($_GET['q']))));
         }
         else {
