fix output sequence of lines