Better handling of timeout.