get_token() no longer results in an infinite loop