fix error on reduced.R