Update forPathsMatching to handle params if specified