multicolour undo fix, will fix multi type of brush and etc