fix stupid file write issue