better logging and menuitem handling