critical error in the settings function corrected