Updated JS to catch obscure error