This is working fully in Chrome but fails with PhantomJS.