added timeout exception handling