Fixed onWrite send error.