add error handler for launching phantomjs to avoid uncontrolled process termination