Fix for connection close