Gold mine can not be haunted through an ability being cast

i set gold mine as target unit of ability being cast and while i get resources, as i have specified farther down into the trigger, the gold mine does not get haunted. unless i specify a specific gold mine as the target in the trigger.