Fixed session variable reset bug