fix crash on right-click.