fixed double partitioning bug -bad indexes for partitions