fixed bug with populating field with previous value