fix path segment matching