updates to handler to handle custom menuitem