bug fixes and session expiration