made button visible/unvisible depending on state