bug fixes; smoother session management