Added functionality for saving user data