Fixing issue with PhantomJS