truncate before overwritten
Merge pull request #61 from ZhengYang/master

truncate before overwritten