add patched function