Added javascript error handler & logger