use timer to update encoded