crash fix on save settings