fixing session bugs