replace local variable