changed a global variable to a session variable