Script to read messages fixed