Added stopping, proper connection closing