enable/disable buttons depending on state