addResource(), which is potentially calculation intensive, was called twice every time a resource was newly enabled.