bug fixes on session