better session handling