fix bug where @fields is being overwritten