enhanced example updated for node >= v0.10