fixed checkForUpdate function