changes to fix globals not working in prodution