missed a few scope issues