Fix for bug, when connection is broken between send and recv