redo changes from mine
Fixing session visibility.
Minor - format code
Fixing getUser exception.