add functionality to add to mongodb