fixed bug with javascript on deleting a badge