copy state (seems to be working finally)