fix exit when error