added check that resource provided is a valid resource name