Prevent multiple event registrations on reconnect

Added a check to ensure that events are not registered with socket.io multiple times when a reconnect occurs.