Added updating of button states