Fixed an issue that prevent badges from showing on navbar

The badge shows correctly after this change.