The invention relates to compounds of formula I wherein R1, R2, X, Y, and n are defined in the specification and to pharmaceutically acceptable acid addition salts thereof. The invention also provides pharmaceutical compositions and methods of manufacture of such compounds. The compounds are useful for the treatment of diseases related to the biological function of the trace amine associated receptors, which diseases are depression, anxiety disorders, bipolar disorder, attention deficit hyperactivity disorder, stress-related disorders, psychotic disorders, schizophrenia, neurological diseases, Parkinson's disease, neurodegenerative disorders, Alzheimer's disease, epilepsy, migraine, substance abuse and metabolic disorders, 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.