Closing connection not dumb way

Change-Id: I9d967e54155215d06a6b536faada986f6fd1bdc1