Fixing type issue in phantomjs