Following try...except should be changed too.