get resource function