Hack to avoid a crash bug when exiting settings.