fix exit error code on errors