fixed bug in timeout.