Implement reconnect functionality