fix for global references