Update commandt function.