fixed bug to insert remainder of lines #3