debug: fixed everlasting loop