added corner case when timeout is over