Updated button logic