fix bug when there are too few features