stats
better handling of error/disconnect