fix multi edition of shapes and save in the db