WaitForSeconds acting oddly

At the end of the level, I want to wait three seconds, then increment my level counter. I then need to instantiate a certain number of platforms based on the level. I tried using an IEnumerator with yield return new WaitForSeconds(3f) but this constantly increments level, crashing Unity. Is there a way to simply pause for a certain amount of time, or am I using WaitForSeconds wrong? Here is my code:

IEnumerator nextLevel(){
    yield return new WaitForSeconds(3f);
	level++;
	maxPlatforms = 4 * (level * level) - 4 * level + 1;
	player.GetComponent<InputManager>().startedGame = false;
    //etc
}

I assume you’re calling the function multiple times, which makes a new instance of the coroutine each time. You should make sure to call it only once.