fix bug when get field from a js function