Bug fix for MongoDb insert