Fixing session check