Added javascript for better UX with badge deletion