Added Save preferences method