updated badge functionality