slight modification on badge logic