fixing privateKey storage and retrival after loginning with one