copy constructor for resource