some session bugfixing