add timer event and socket close
bug fix