Fix/connection reset issue 187