Loading current level going wrong.

Hello all, I am making a tower defense game and i was adding a restart button, it calls this function " SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);"

but when i run it it will restart the scene and then the “Wave counter” in the game skyrockets and skips higher and higher, but it will stop at a random number, and I can’t figure out why. please help cause it is kind of important to be able to restart the game.

Anyone know a fix for this?

Never mind I figured it out. It was a problem with my wave manager.