Added timeout exception handling.