fixed a bug that caused the client to freeze