modified business logic for handling folders and email messages after
timeouts and during multiple instances.