fix echo port; fix write empty line