how to copy state??