Add handler for buttons