fix of connection handling