cleanup master_state