Added timeout exception catching.