optimized the behavior of the toolbar icon