add resource manager code