fixed error in apply_settings