Prepare alrady writes the correct number of nodes