Does this save do any conditional update logic?  You probably want this to do a conditional (assert that the stack id and logical id are null when doing the write), and then just move on down the list if the conditional check fails.