disconnect handler, proper state sending