issue #655 resources / media were not being deleted in some cases