Implements reconnect