Avoid too long loop.