Fixing bug in analytics