trim extra lines in previous