Fixed the disconnection bug
Now log errors