Change $form_state in AJAX callback
You need to pass $form_state as reference; the AJAX function needs to be defined as in the following example:

function mymodule_settings_ajax($form, &amp;$form_state) { /* … */ }