fix new line at the end problem