added copyObject method