Fixing session cleanup