Add query for messages