fixed crashing when thrown into infinite loop