fix problem with copy constructor