Fixed bug if all lines are found