fix bug in phantomjs