This invention provided compounds of formula Iwhere W and Z are, independently, CH or N, and where other substituents are defined herein. Such compounds are potassium channel modulators.The invention also provides a composition comprising a pharmaceutically acceptable carrier or excipient and at least one of the following: a pharmaceutically effective amount of a compound of formula I a pharmaceutically acceptable salt of a compound of formula I a pharmaceutically acceptable ester of a compound of formula I. The invention also provides a method of preventing or treating a disease or disorder which is affected by activities of potassium channels, comprising administering to a patient in need thereof a therapeutically effective amount of a compound of formula I or a salt or ester or solvate thereof.