sort message queue before collapsing