fix bug with copy constructors