* sort messages by status; * add index for DB