fix for close connection