Created checkUpdate function