fix bug when binsize is larger than range of data