New function, checkButtons