changed structure to save credentials onto machine