updated buttons logic