fixing bug with primary mongo ids not persisting