oops! The error is in line 7. the lineList is copied from old code. should be

->remove(line);