fix version detection while preserving backward compatiblity