make sure connection is properly released