more robust getVersion