fix bug about timeout
remove unused code.