Fix resort after refactoring