testing methods for stopping threads