tuned the apply_settings script to be more thorough