remove extra nodes