added CopyData function to store data locally, fixed compilation error in main.go