Catch Firefox exception on reloading the page