client: fix RangeError: Maximum call stack size exceeded

closes #147