fix deep clone and equals comparison