method for fetching token