fixed deep array cloning