Added session timeout code