Fix bug with button states