Fixed a bug

The script now reads all the messages in a thread.