clone global var instead of changing it