fix some errors with disconnects