Added check when resource doesn't exist.