fix detection of patch method