close connection half way through