taking 2nd to last line after finding the last line is set to invalid until it arrives