Fix bug in SceneManager