Better disconnect handling