Fix premtive connection closing