Fix bug in releasing service connection