updated with pymongo