Thread handling changed