small changes to toggle badge and flash messages