       JUser.fetchGuestUser (err, response) ->
 
         if err
-          return logout 'error fetching guest account', clientId, callback
+          return terminateSession 'error fetching guest account', clientId, callback
 
         { account } = response
         if not response?.account
-          return logout 'guest account not found', clientId, callback
+          return terminateSession 'guest account not found', clientId, callback
 
         account.profile.nickname = username
 


  checkSessionValidity = (options, callback) ->

    { session, logout, clientId } = options
    { username } = session

    unless username?

      # A session without a username is nothing, let's kill it
      # and logout the user, this is also a rare condition
      logout 'no username found', clientId, callback

      return



      if err

        terminateSession 'error finding user with username', clientId, callback

      else unless user

        terminateSession "no user found with #{username} and sessionId", clientId, callback

      else

