Fixed session variable, added more IE compatabililty