fix crash when extending a newly added line