fix for the stupid bug in session handling