refactored broadcast event function to toggle sign in and sign out links