bugfix for broken session handling