Crash fix when checking device version