move buttons out of for loop