fixed bin index error