Prevents infinite loop.