updated for MongoDB