Added code to stop inserting more data on top of existing data in MongoDb.