improved check_id_map check