fixing session clearing issue