Fix infinite loop in service_token method