added patching stuff