bug fix: thread stopping