Did you plug the the hose off the inlet when you removed the valve? If not then the inlet is not seated correctly.
or hose off the back of inlet for brake booster?
Basically you have unmetered air entering the engine and that's why it's revving up on its own. Also check the seal under the upper inlet to the breather plate.
All sorted had traped an HT lead under the inlet
Many thanks for your help .
Alan