handle phantomjs stderr events better