Updated to account for the latency between 'data' and 'end' events; still no success