fix a re entrancy bug in panel affecting menu