fix and test for when related resource doesn't exist