changed the mongo module code to fix an issue