fix bugs related to foreign objects
fixes for legislator example