Made docpatch variable global