BugFix on socket reconnection