made better button state changes