add messages limit and rename to messagesRef