thread also should be joined here for clean exit