Fix WS performance issues