# RandomPrime inside Manipulate gets evaluated multiple times

Manipulate[
m = RandomPrime[d];
{m, d},
{d, {20, 50}, SetterBar}
]


Basically, I expected the code to generate a random prime m (under the upper bound d) for me to make some graphics about m. However, the piece of code evaluates m multiple times, which is bewildering to me. Probably I need to use Dynamic here, but I have not figured it out.

How can I evaluate the RandomPrime function for only once?

whenever you use Manipulate, use TrackedSymbols to tell it which symbols to track
Manipulate[m = RandomPrime[d];