fix bug for timeout