fix bug with Collection.onSort