add check for a not existing thread