updated to support MongoDB 2.4+