add checks when retrieving internal session