The comment here. Isn't it two rows up that sets the id to -1? :)