added functionality to buttons