Fixed the bug in "messages" array