modify for new mongodb version