fix EventSource threading issues