handle phantomjs crash