messages: fixed messages priority sort