Badges js bugfix