fix for resource deletion