added in logic to find the buttons