Temp fix for rare crash in thread messages.py