add handler for tag buttons
fix instance variable intialization and take first argument in event handler