improved version checking