Updated for PhantomJS issue migration