add reconnect before second select in change_master