added more graceful disconnections