added thread stopping & quicker stream_handler termination