Updated save_user function