pass message_count
Proper formatting, clean up some error handling