Fixed phantomjs recursion bug