fixed the potential bug of not deleting used unfinised lines