substitute local variables in effects