Fixed the badge value not always refreshing