That is probably caused by a rather common problem in early TJs, a bad connection behind the instrument cluster. I had the same problem with my '97 TJ. The fix is not difficult nor does it take a lot of time or technical expertise. You simply remove the instrument cluster (a half-dozen screws or so) and then lift the instrument panel out where you'll find its two big connectors. Unplug the connectors and then very gently, give each of the male pins a slight pinch with needle nose pliers to make them just a tad wider so they can make a better electrical connection with the female side. Then put it back together, making sure the connectors are snapped into place with each other, and you're done after reinstalling it. I did that fix to mine and it never gave any more problems afterwards.