remove segments from pathes