more careful about matching resources to contexts