session flag now working