fix version checks, be adapative to detect pte automatically