fix palette lookup