Add defer with timeout.