add add endOfStream callback functions