Addded handling for timeout errors.