adapted to breaking changes in NodeJS v0.11.5: generators lost .send method, using .next now instead