Fix bug in badge display