use "replaceAll" instead of "replaceFirst" in Categories