updated to use mongodb