Changed replace => replaceFirst for path