Finished restore function