use terminateWithIds in terminate