added infinite loop catcher