the invention relates to compounds of formula wherein r 1 , r 2 , r 3 , r 4 , x , ar , and are defined herein or to a pharmaceutically suitable acid addition salt thereof . compounds of formula i have a good affinity to the trace amine associated receptors , especially for taar1 . the compounds can be used for the treatment of depression , anxiety disorders , bipolar disorder , attention deficit hyperactivity disorder , stress - related disorders , psychotic disorders such as schizophrenia , neurological diseases such as parkinson &# 39 ; s disease , neurodegenerative disorders such as alzheimer &# 39 ; 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 .