add infinite loop checker.
for readability.