fix bug with response var being used before assignment