fixed connet bug,add log function