Added some session handling