possible fix to analytics code