moved sort() after listDir