fix the bug in binning