fix crash on stop