add apply function on fields