I think it's better to use `break` instead of monitoring `success` in while.