fixed session variables, completed issue #2