fix crash for accidental palette