closing connections after threads finished.