fixed up session stuff