Fix a crash when transit scene.