fixing bug where sorting fails after recompute