added time tracking to prevent robot being idle