fixed getBins operation