sort entries and public flag