adding functionality to a button