Readded the check for stopped thread since I accidently removed it.