fix javascript connect event bug  #24