fix rebinning bug