Fixed a bug where under some circumstances client would freeze