fix bug when timeout