Fix duplicate connections when calling open