adding badge control code