replaced UIPopoverController with WEPopoverController for iPhone compatibility and simplified code