Corrected assigning of buttons