cleans up trailing new line