hrm, actually it seems like every var in the function is leaked here. maybe there is a reason for it?