connection leak bugfix