Added catching of timeout exceptions.