check for palette existence before using it