fix session writing
Merge pull request #64 from hayate/master

fix session writing