The present invention relates to compounds of formula I,whereinR1 is phenyl, lower alkyl, C3-6-cycloalkyl, —;CH2—;C3-6-cycloalkyl, or bridged C3-5-cycloalkyl, optionally substituted by one, two or three substituents, selected from halogen, lower alkyl or lower alkyl substituted by halogen;R2 is hydrogen, halogen, lower alkoxy, lower alkyl substituted by halogen or lower alkoxy substituted by halogen;R3 is a five membered heteroaryl group, selected fromwhereinR6 is hydrogen or lower alkyl;R7 is halogen or lower alkyl;R8 is hydrogen or lower alkyl;R9 is hydrogen or lower alkyl;R4 is lower alkyl or lower alkyl substituted by hydroxy;R5/R5′; is independently from each other hydrogen or lower alkyl;-( )n- is —;CH2—; or —;CH2CH2—; for n being 1 or 2;X is CH or N;or to pharmaceutically active acid addition salts thereof, to racemic mixtures or to its corresponding enantiomers and/or optical isomers and/or stereoisomers thereof.The compounds may be used for the treatment of Alzheimer's disease, cerebral amyloid angiopathy, hereditary cerebral hemorrhage with amyloidosis, Dutch-type (HCHWA-D), multi-infarct dementia, dementia pugilistica or Down syndrome.