added sleep time to read messages in debug mode