[FIX]function field code done according to new api.