Change var elem in var code