add update speed function