added service replacement function