Added a counter to record messages

Must use a counter to keep alignment with timestamp on arrays