fixing bug with formatFieldWithFunctionAdvanced