change badge logic