implement clicking button function