Changed where the frame of the buttons is calculated