Add callback on stream end.