modified to save credentials temporarily and permanently if desired
refined loading so that last configuration automatically loads