added functionality to buy button