add function of save canvas to mongodb