added Function.prototype.bind so phantomjs can work