App occasionally crashes due to connection's input stream reader returning an empty string. In the process of debugging