fix for bad references - actually works now.