ui buttons switch state correclty