Added logic for Badge counter