Sorting fix port from client.js take 2