FIx bug with generating mongo ids