fixed string writing issue.