make compatible with new PhantomJS