add ability to limit number of messages returned
add ability to limit number of messages returned