works fine - after adding timeout to the socket