fixed bugs in session timeout