use of limit instead of latest to dynamically decide how many messages to retrieve