Changed Try/Except/Finally block on main loop