improve check_master