fix issue when sorting is disabled