Hello,
If, as we can guess it, you destroy a line, you need to loop from the bottom to the top !
Code:
For i =  last ti i step -1
If you do'nt, you will obviously refer to a non existing line !