Added state button logic to some elements