moved function to twitter_demo js file