Fix logic of the button presses