I just got a 1990 525i 5 speed with just under 200,000 miles but the motor was rebuilt and a new clutch was put in.

When i let the car sit in idle the rpms go up and down like im hitting the gas and letting go. It does this when i first turn the car on but if i put it in gear and drive for a bit and then stop, it idles like normal. Im just wondering if this is a problem and if it so what could be wrong?