fix exit error bug