add signal handler for stopping the stream