remove the connection if the mode does not match