fix S.append issue