button state logi