Made a general update settings function