attempt to catch js errors