Fix crash when opening settings
