improve the version check