added resource management