Created restore function