checkIsOnValidThread