removing the last node endpoints