bugfix: find a better way of closing the idle connections