if controller not found, such as when popover or alert view open, try to find with window object