fixed popup menu crashes.