Move declaration of ioxEvent outside of try{} block