fix version check logic