Adding method to validate path segments.