Unless I'm missing something, it looks like you add it and then later overwrite it.  Why do the extra work?