improved handling in case logging is disabled
stronger sort in processing the messages