fix control issue :
  replace writeChars() with writeBytes()