inventory sorting fix