sort before dump