exit when error in main