fix always add new line at the eof