refactored the setAuthtoken