fix for connection closing