fix orderby-key for sorting by primary key