fix issue with sort in schemaless mode