add resource management