huge fix after sorting