A Compound of the formula or a pharmaceutically acceptable salt thereof, Ar is L is H, optionally substituted or unsubstitued alkyl, optionally substituted or unsubstitued cycloalkyl, optionally substituted or unsubstitued cycloalkylalkyl, optionally substituted or unsubstitued aryl, optionally substituted or unsubstitued arylalkyl, optionally substituted or unsubstitued sulfonamido, optionally substituted or unsubstitued heterocycloalkyl, optionally substituted or unsubstitued heterocycloalkylalkyl, optionally substituted or unsubstitued heteroaryl, or optionally substituted or unsubstitued heteroarylalkyl; when substituted, the substituents can be one or more groups independently selected from the group consisting of halo, alkyl, haloalkyl, cycloalkyl, cycloalkylalkyl, heterocycloalkyl, heterocycloalkylalkyl, amino, aminoalkyl, amido, aminocarbonyl, sulfonamido, ureido, cyano, acetyl, acyl, carboxylic acid, hydroxyl, hydroxylalkyl, alkoxyl, - NHalkylhydroxyl, -NHalkoxyalkyl, -NHalkylamnio, -NHcycloalkyl, -NHcycloalky- lalkyl, - NHheterocycloalkyl, -NHheterocycloalkylalkyl, -NHaryl, -NHarylalkyl, -NHheteroaryl, or -NHhetero-arylalkyl; Y is O, S, NR 2 R 2 ' or a direct bond; X 1, X 2, X 3 and X 4 are independently N or CR 1; but when X 4 is N, X 1, X 2, X 3 are not CR 1 at the same time; R 1 is H; R, R 2, and R 2 ' are each independently selected from the group consisting of hydrogen, alkyl, cycloalkyl, aryl, heteroaryl, haloalkoxyl, hydroxyl, amino, amido, aminocarbonyl, sulfonamido, cyano, alkynyl, alkoxyl, aryloxyl, carboxylic acid, carboxylic ester or halogen, or R 2, R 2 ' together with the nitrogen atom to which they are attached, formed a 3- to 7-membered heterocycloalkyl ring, and the hetero atom could be selected from at least one of O, S or N atoms, the 3- to 7-membered heterocycloalkyl ring could be further optionally substituted with a group independently selected from alkyl, cycloalkyl, methylsulfonyl, ureido, acyl, amido, aminocarbonyl, alkylamino, alkylhydroxyl, heterocycloalkyl, aryl, or heteroaryl. Ar is L is H, optionally substituted or unsubstitued alkyl, optionally substituted or unsubstitued cycloalkyl, optionally substituted or unsubstitued cycloalkylalkyl, optionally substituted or unsubstitued aryl, optionally substituted or unsubstitued arylalkyl, optionally substituted or unsubstitued sulfonamido, optionally substituted or unsubstitued heterocycloalkyl, optionally substituted or unsubstitued heterocycloalkylalkyl, optionally substituted or unsubstitued heteroaryl, or optionally substituted or unsubstitued heteroarylalkyl; when substituted, the substituents can be one or more groups independently selected from the group consisting of halo, alkyl, haloalkyl, cycloalkyl, cycloalkylalkyl, heterocycloalkyl, heterocycloalkylalkyl, amino, aminoalkyl, amido, aminocarbonyl, sulfonamido, ureido, cyano, acetyl, acyl, carboxylic acid, hydroxyl, hydroxylalkyl, alkoxyl, - NHalkylhydroxyl, -NHalkoxyalkyl, -NHalkylamnio, -NHcycloalkyl, -NHcycloalky- lalkyl, - NHheterocycloalkyl, -NHheterocycloalkylalkyl, -NHaryl, -NHarylalkyl, -NHheteroaryl, or -NHhetero-arylalkyl; Y is O, S, NR 2 R 2 ' or a direct bond; X 1, X 2, X 3 and X 4 are independently N or CR 1; but when X 4 is N, X 1, X 2, X 3 are not CR 1 at the same time; R 1 is H; R, R 2, and R 2 ' are each independently selected from the group consisting of hydrogen, alkyl, cycloalkyl, aryl, heteroaryl, haloalkoxyl, hydroxyl, amino, amido, aminocarbonyl, sulfonamido, cyano, alkynyl, alkoxyl, aryloxyl, carboxylic acid, carboxylic ester or halogen, or R 2, R 2 ' together with the nitrogen atom to which they are attached, formed a 3- to 7-membered heterocycloalkyl ring, and the hetero atom could be selected from at least one of O, S or N atoms, the 3- to 7-membered heterocycloalkyl ring could be further optionally substituted with a group independently selected from alkyl, cycloalkyl, methylsulfonyl, ureido, acyl, amido, aminocarbonyl, alkylamino, alkylhydroxyl, heterocycloalkyl, aryl, or heteroaryl.