viewgoal js uncaught exception fix