copy and paste now correctly copies state