Fixing crash in settings