Fix to set partition algo and adding some debug logs