Add Logger, fixed disconnect bug