keep only a constant number of messages in history