fix copy in StateMatrix