The present invention relates to compounds of formulawherein R1is hydrogen, lower alkyl, halogen, lower alkyl substituted by halogen, lower alkoxy, lower alkoxy substituted by halogen, cyano, nitro, C3-6-cycloalkyl, -CH2-C3-6-cycloalkyl, -O-CH2-C3-6-cycloalkyl, -O-(CH2)2-O-lower alkyl, S(O)2CH3, SF5, -C(O)NH-lower alkyl, phenyl, -O-pyrimidinyl, optionally substituted by lower alkoxy substituted by halogen, or is benzyl, oxetanyl or furanyl; m is 1 or 2; Ar is aryl or heteroaryl, selected from the group consisting of phenyl, naphthyl, pyrimidinyl, pyridinyl, benzothiazolyl, quinolinyl, quinazolinyl, benzo[d][1.3]dioxolyl, 5,6,7,8- tetrahydro-quinazolinyl, pyrazolyl, pyrazinyl, pyridazinyl, or 1,3,4-oxadiazolyl; Y is a bond, -CH2-, -CH2CH2-, -CH(CF3)- or -CH(CH3)-; R2is hydrogen or lower alkyl; A is CR or N; and R is hydrogen, cyano, halogen or lower alkyl; R’ is hydrogen or halogen; with the proviso that when R’ is halogen, then A is CH; B is CH or N; n is 0, 1 or 2; X is a bond, -CH2- or -O-; or to pharmaceutical active acid addition salts thereof.It has now been found that the compounds of formula I have a good affinity to the trace amine associated receptors (TAARs), especially for TAAR1. The compounds may be used for the treatment of depression, anxiety disorders, bipolar disorder, attention deficit hyperactivity disorder (ADHD), stress-related disorders, psychotic disorders such as schizophrenia, neurological diseases such as Parkinson’s disease, neurodegenerative disorders such as Alzheimer’s disease, epilepsy, migraine, hypertension, substance abuse and metabolic disorders such as eating disorders, diabetes, diabetic complications, obesity, dyslipidemia, disorders of energy consumption and assimilation, disorders and malfunction of body temperature homeostasis, disorders of sleep and circadian rhythm, and cardiovascular disorders.本發明係關於下式化合物:其中R1係氫、低碳烷基、鹵素、經鹵素取代之低碳烷基、低碳烷氧基、經鹵素取代之低碳烷氧基、氰基、硝基、C3-6-環烷基、-CH2-C3-6-環烷基