Updated plugin to support sorted collections