The present invention relates to the use of a compound of formula I wherein R1, R2, R3, R4, X and n are as defined herein or to a pharmaceutically acceptable acid addition salt, to a racemic mixture, or to its corresponding enantiomers and/or optical isomers for the treatment of psychoses, pain, dysfunction in memory and learning, attention deficit, schizophrenia, dementia disorders or Alzheimers disease.