Fixed popupmenu bug