Update messages.py

Updated with Terry Jones suggestion.