updates button logic