Exit thread fix