Made changes to the way buttons are disabled/enabled