call onDrain() on('drain') instead of flush()