update for generators and threads