Fix the creation of EventSource