fixed bug that deleted all the connected lines when removing just one