automatic patching system