writeobj fix