The invention relates to compounds of formulawherein R1, R2, R3, R4, X, Ar, andare defined hereinor to a pharmaceutically suitable acid addition salt thereof. Compounds of formula I have a good affinity to the trace amine associated receptors (TAARs), especially for TAAR1. The compounds can 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.