add deep copy to preserve mutable arguments (e.g. lists)