add better exception handling. move check of largest tweet id inside the authenticate function