properly fix patching