update the global model