better checking for valid version