add the button status logic.