fix version detection for some cases