improve performance of get_messages method
merge conflict