Add parent id to written items