Move addField function to the top of the calls