fixes for phantom.js