fixed exception handling an ANNIE and Main