adding functionality to buttons