modified as colors were changing when erasing a curve