fix the popupmenu issues