The invention relates to compounds of formulawherein R1, R2, R3, R4, and Ar are as defined in the specification and claims, or to pharmaceutically active acid addition salts of such compounds. Compounds of formula I are modulators for amyloid beta and may be useful for the treatment or prevention of a disease associated with the deposition of β-amyloid in the brain, in particular Alzheimers disease, and other diseases such as cerebral amyloid angiopathy, hereditary cerebral hemorrhage with amyloidosis, Dutch-type (HCHWA-D), multi-infarct dementia, dementia pugilistica and Down syndrome.