save user after generating key