Updated method in canvas controller to save groups after dragging