implemented the settings logic