Fixing the calc of resources to be compatible with more entities