added support for PhantomJS