adding close on stream