show the correct state when leaving the button