removing double paths for categories