Fix a crash on device when changing a scene