Improved the check for updates function