added not-nil for thread last