Added exception handler to twitter request function