move declaration into block

vs2012u1 does not like declarations in the middle of the block