Added localStorage handling for settings