Improved operating system check