hide buttons according to state