stop detection bug fixed