Fix Uncaught RangeError: Maximum call stack size exceeded n.ondisplay