Added have logic for saving and restoring into xml