Small modifications to catch timeout events.