bugfix keeping account of connection ends