properly scope variable with target's response outside the begin block