fix bug with color palette getting copied