A compound of formula or a pharmaceutically acceptable salt thereof wherein: R 1 is hydrogen, C 1-6 alkyl, C 1-6 haloalkyl, halo or cyano; M is CH or N; L is O, NH or N(CH 3); A is CR 5 or N; W is CR 6 or N; R 2, R 5 and R 6 are independently hydrogen, C 1-6 alkyl, C 1-6 haloalkyl, halo, C 3-7 cycloalkyl or cyano; X, Y, and Z are independently CH or N; and R 3 and R 4 are independently hydrogen, halo, cyano, C 1-6 alkyl, C 1-6 haloalkyl, C 2-6 alkenyl, hydroxyl-C 1-6 alkyl, di-(C 1-6 alkylamino)-C 1-6 alkyl, amino, C 1-6 alkylamino, C 3-7 cycloalkylamino, di-(C 1-6 alkyl)amino, amino-C 1-6 alkylamino, C 1-6 alkoxy-C 1-6 alkylamino, C 1-6 alkoxycarbonyl-C 1-6 alkylamino, di-(C 1-6 alkoxy-C 1-6 alkyl)amino, aminocarbonyl, C 1-6 alkylaminocarbonyl, di-(C 1-6 alkyl)aminocarbonyl, C 3-7 cycloalkylaminocarbonyl, C 1-6 alkoxy, C 3-7 cycloalkoxy, hydroxyl-C 1-6 alkoxy, C 1-6 haloalkoxy, amino-C 1-6 alkyl, amino-C 1-6 alkoxy, C 1-6 alkylsulfonyl, C 2-6 alkenylsulfonyl, C 3-7 cycloalkylsulfonyl, heterocyclyl optionally substituted by B, aryl optionally substituted by B, heteroaryl optionally substituted by B, C 1-6 alkylsulfonylamino, C 2-6 alkenylsulfonylamino, C 3-7 cyclooalkylsulfonylamino, amido, C 1-6 alkylcarbonylamino, C 2-6 alkenylcarbonylamino, C 3-7 cyclooalkylcarbonylamino, C 1-6 alkoxycarbonylamino, C 3-7 cycloalkoxycarbonylamino, ureido, C 3-7 cycloalkyl, C 3-7 halocycloalkyl, heterocyclyl-oxy, piperidinylamino, N-methyl-piperidinyl-4-carbonyl, piperazinyl-C 1-6 alkyl, pyrrolylcarbonylamino, N-methyl-piperidinylcarbonylamino or heterocyclyl-C 1-6 alkoxy; or R 3 and R 4 together form a 3 to 8-membered ring with the atoms in the aromatic ring to which they are attached; and B is hydrogen, C 1 - 6 alkyl, C 1 - 6 haloalkyl, halo, hydroxyl, aryl, amino, C 1 - 6 alkylamino, C 3 - 7 cycloalkylamino, di-(C 1-6 alkyl)amino, cyano, or C 3 - 7 cycloalkyl. R 1 is hydrogen, C 1-6 alkyl, C 1-6 haloalkyl, halo or cyano; M is CH or N; L is O, NH or N(CH 3); A is CR 5 or N; W is CR 6 or N; R 2, R 5 and R 6 are independently hydrogen, C 1-6 alkyl, C 1-6 haloalkyl, halo, C 3-7 cycloalkyl or cyano; X, Y, and Z are independently CH or N; and R 3 and R 4 are independently hydrogen, halo, cyano, C 1-6 alkyl, C 1-6 haloalkyl, C 2-6 alkenyl, hydroxyl-C 1-6 alkyl, di-(C 1-6 alkylamino)-C 1-6 alkyl, amino, C 1-6 alkylamino, C 3-7 cycloalkylamino, di-(C 1-6 alkyl)amino, amino-C 1-6 alkylamino, C 1-6 alkoxy-C 1-6 alkylamino, C 1-6 alkoxycarbonyl-C 1-6 alkylamino, di-(C 1-6 alkoxy-C 1-6 alkyl)amino, aminocarbonyl, C 1-6 alkylaminocarbonyl, di-(C 1-6 alkyl)aminocarbonyl, C 3-7 cycloalkylaminocarbonyl, C 1-6 alkoxy, C 3-7 cycloalkoxy, hydroxyl-C 1-6 alkoxy, C 1-6 haloalkoxy, amino-C 1-6 alkyl, amino-C 1-6 alkoxy, C 1-6 alkylsulfonyl, C 2-6 alkenylsulfonyl, C 3-7 cycloalkylsulfonyl, heterocyclyl optionally substituted by B, aryl optionally substituted by B, heteroaryl optionally substituted by B, C 1-6 alkylsulfonylamino, C 2-6 alkenylsulfonylamino, C 3-7 cyclooalkylsulfonylamino, amido, C 1-6 alkylcarbonylamino, C 2-6 alkenylcarbonylamino, C 3-7 cyclooalkylcarbonylamino, C 1-6 alkoxycarbonylamino, C 3-7 cycloalkoxycarbonylamino, ureido, C 3-7 cycloalkyl, C 3-7 halocycloalkyl, heterocyclyl-oxy, piperidinylamino, N-methyl-piperidinyl-4-carbonyl, piperazinyl-C 1-6 alkyl, pyrrolylcarbonylamino, N-methyl-piperidinylcarbonylamino or heterocyclyl-C 1-6 alkoxy; or R 3 and R 4 together form a 3 to 8-membered ring with the atoms in the aromatic ring to which they are attached; and B is hydrogen, C 1 - 6 alkyl, C 1 - 6 haloalkyl, halo, hydroxyl, aryl, amino, C 1 - 6 alkylamino, C 3 - 7 cycloalkylamino, di-(C 1-6 alkyl)amino, cyano, or C 3 - 7 cycloalkyl.