Improve the validation and set the button state based on running or
paused.