Fix bad try except syntax