get_token returns undef the first time it's called