added ringbuffer for msgs