check for same thread id