added connection closing