Performance fix for wordcloud script