Define handler for the toolbar button