Fixed disconnection logic
- Server now correctly closes client connection