Avoided some errors by disabling buttons.