stop detection changed to time based
time-based stop detection working correctly!