Solve writing error
Merge pull request #241 from wagnert/master

Solve writing error