fixes palette read bug