fixed palette_reduce error