replace `ui.write` with `ui.writeLine`