tried to fix the grid sorting