added check for resource and function