make non-/local detection more robust