Only syncronize the inventories after sorting is complete.

Syncronizing during the process causes the sorting proccess to look really strange even on a localhost server.