Handle timeout exceptions gracefully