added the resource func