bug fixes

Hopefully have fixed the session timeout better