bug fix - use pair<id, type> as key of resource container