corrected scope of fields var