use if instead of try