Fixed problem of connection crashing while exiting if video stream is on