Cool while moving and hot while standing means air is not being pulled through the radiator, so the fan is not doing its job. The fan is three parts — motor, relay and sensor — and the relay costs a tenth of the motor.
Do not keep driving it to see. An engine that boils once can cost a head gasket, which is a week of work. Pull over, put the heater on full to dump some heat, and call us.